<?php
    if(is_array($result))
	{
		header('Content-Type: application/json; Charset=UTF-8',true);
		$jsonData = array('page'=>$stockMovimFN->page,'total'=>$stockMovimFN->numeroRegistros,'rows'=>array());
		foreach ($result as $key => $obj)
		{
			$entry = array('id'=>$obj->getAlmId(),
			    'cell'=>array(
			            'docId'=>utf8_encode($obj->getDocId()),
			            'docNum'=>utf8_encode($obj->getDocNum()),			    
			            'almacenId' =>$obj->getAlmId(),
			            'articuloId'=>utf8_encode($obj->getArtId()),
			            'ingSal'=>utf8_encode($obj->getIngSal()),
			            'movTipo'=>utf8_encode($obj->getMovTipo()),                                
                                    'cant'=>utf8_encode($obj->getCant()),			            			            
                                    'costo'=>utf8_encode($obj->getCosto()),	
                                    'saldoAnt'=>utf8_encode($obj->getCantAnt()),	
                                    'fechaMov'=>utf8_encode($obj->getCreaFecha()),
			            'opciones'=>"<img border='0' title='Detalle Item' src='/gourmet-express/trunk/imgs/icons/application_view_list.png' onclick=fn_detalle('". $obj->getAlmId()."') style='cursor:pointer;'>"
			    ),
			);
			$jsonData['rows'][] = $entry;
		}
		echo json_encode($jsonData);
	}?>